<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Verb Conjugation</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Preform-Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Verb Conjugation' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../services.html">Services</a></li><li><a href="index.html">inflections</a></li><li><a href="index.html#3">Chapter 3: Declension and Conjugation</a></li><li><b>Verb Conjugation</b></li></ul></div>
<p class="purpose">Conjugating verbs into the many different forms they can take.</p>

<ul class="toc"><li><a href="3-vc.html#SP2">&#167;2. Finding</a></li><li><a href="3-vc.html#SP6">&#167;6. Making conjugations</a></li><li><a href="3-vc.html#SP7">&#167;7. Follow instructions</a></li><li><a href="3-vc.html#SP8">&#167;8. Merge verb material</a></li><li><a href="3-vc.html#SP11">&#167;11. Parsing verb form numbers</a></li><li><a href="3-vc.html#SP12">&#167;12. Parsing tense and sense indicators</a></li><li><a href="3-vc.html#SP13">&#167;13. Parsing utilities</a></li><li><a href="3-vc.html#SP15">&#167;15. Errors</a></li><li><a href="3-vc.html#SP16">&#167;16. Testing</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>We will need to turn a base form of a verb &mdash; in English, this is always the
infinitive &mdash; into up to 123 variants; we manage this with quite an extensive
data structure. There will typically only be a few dozen fully conjugated
verbs in any source text, though, so the memory cost isn't too extreme. For
English it looks wasteful, since so many forms are the same, but for French
</p>

<ul class="items"><li>(say) they are almost all different.
</li></ul>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">infinitive</span><span class="plain-syntax">; </span><span class="comment-syntax"> not counting the "to", in English</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">past_participle</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">present_participle</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">verb_tabulation</span><span class="plain-syntax"> </span><span class="identifier-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">NO_KNOWN_VOICES</span><span class="plain-syntax">];</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">NATURAL_LANGUAGE_WORDS_TYPE</span><span class="plain-syntax"> *</span><span class="identifier-syntax">defined_in</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">LINGUISTICS_MODULE</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">verb</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vc_conjugates</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">VC_COMPILATION_INFLECTIONS_CALLBACK</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">verb_conjugation_compilation_data</span><span class="plain-syntax"> </span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">auxiliary_only</span><span class="plain-syntax">; </span><span class="comment-syntax"> used only as an auxiliary, e.g. the "have" in "I have gone"</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">instance_of_verb</span><span class="plain-syntax">; </span><span class="comment-syntax"> defines an instance of kind "verb" at run-time</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">verb_tabulation</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">to_be_auxiliary</span><span class="plain-syntax">; </span><span class="comment-syntax"> use this if non-empty</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">vc_text</span><span class="plain-syntax">[</span><span class="constant-syntax">NO_KNOWN_TENSES</span><span class="plain-syntax">][</span><span class="constant-syntax">NO_KNOWN_SENSES</span><span class="plain-syntax">][</span><span class="constant-syntax">NO_KNOWN_PERSONS</span><span class="plain-syntax">][</span><span class="constant-syntax">NO_KNOWN_NUMBERS</span><span class="plain-syntax">];</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">modal_auxiliary_usage</span><span class="plain-syntax">[</span><span class="constant-syntax">NO_KNOWN_TENSES</span><span class="plain-syntax">][</span><span class="constant-syntax">NO_KNOWN_SENSES</span><span class="plain-syntax">][</span><span class="constant-syntax">NO_KNOWN_PERSONS</span><span class="plain-syntax">][</span><span class="constant-syntax">NO_KNOWN_NUMBERS</span><span class="plain-syntax">];</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">verb_tabulation</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>The structure verb_conjugation is accessed in 2/plr and here.</li><li>The structure verb_tabulation is private to this section.</li></ul>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. Finding.</b>Most of the time, conjugations can be identified by their infinitives:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="function-syntax">Conjugation::find_by_infinitive</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Conjugation::find_by_infinitive</span></span>:<br/><a href="3-vc.html#SP8_4">&#167;8.4</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">infinitive</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">, </span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">WordAssemblages::eq</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">infinitive</span><span class="plain-syntax">, &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infinitive</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">vc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>But in fact multiple conjugations can be given with the same infinitive...
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="function-syntax">Conjugation::find_prior</span><span class="plain-syntax">(</span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nvc</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">nvc</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">, </span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">vc</span><span class="plain-syntax"> != </span><span class="identifier-syntax">nvc</span><span class="plain-syntax">) &amp;&amp; (</span><a href="3-vc.html#SP4" class="function-link"><span class="function-syntax">Conjugation::eq</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">nvc</span><span class="plain-syntax">, </span><span class="identifier-syntax">vc</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">vc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b>...and those may or may not be identical, so a more detailed test is:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Conjugation::eq</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">Conjugation::eq</span></span>:<br/><a href="3-vc.html#SP3">&#167;3</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nvc</span><span class="plain-syntax">, </span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vc</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">WordAssemblages::eq</span><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">nvc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infinitive</span><span class="plain-syntax">), &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infinitive</span><span class="plain-syntax">))) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">WordAssemblages::eq</span><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">nvc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">past_participle</span><span class="plain-syntax">), &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">past_participle</span><span class="plain-syntax">))) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">WordAssemblages::eq</span><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">nvc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">present_participle</span><span class="plain-syntax">), &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">present_participle</span><span class="plain-syntax">)))) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_VOICES</span><span class="plain-syntax">; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">verb_tabulation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nvt</span><span class="plain-syntax"> = &amp;(</span><span class="identifier-syntax">nvc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">]);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">verb_tabulation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vt</span><span class="plain-syntax"> = &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">]);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">WordAssemblages::eq</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                &amp;(</span><span class="identifier-syntax">nvt</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">to_be_auxiliary</span><span class="plain-syntax">), &amp;(</span><span class="identifier-syntax">vt</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">to_be_auxiliary</span><span class="plain-syntax">)) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">t</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">t</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_TENSES</span><span class="plain-syntax">; </span><span class="identifier-syntax">t</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">s</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">s</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_SENSES</span><span class="plain-syntax">; </span><span class="identifier-syntax">s</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">p</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">p</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_PERSONS</span><span class="plain-syntax">; </span><span class="identifier-syntax">p</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">                        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">n</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">n</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_NUMBERS</span><span class="plain-syntax">; </span><span class="identifier-syntax">n</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">                            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">WordAssemblages::eq</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                                &amp;(</span><span class="identifier-syntax">nvt</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">vc_text</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">][</span><span class="identifier-syntax">s</span><span class="plain-syntax">][</span><span class="identifier-syntax">p</span><span class="plain-syntax">][</span><span class="identifier-syntax">n</span><span class="plain-syntax">]), &amp;(</span><span class="identifier-syntax">vt</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">vc_text</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">][</span><span class="identifier-syntax">s</span><span class="plain-syntax">][</span><span class="identifier-syntax">p</span><span class="plain-syntax">][</span><span class="identifier-syntax">n</span><span class="plain-syntax">])) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                                </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">nvt</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">modal_auxiliary_usage</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">][</span><span class="identifier-syntax">s</span><span class="plain-syntax">][</span><span class="identifier-syntax">p</span><span class="plain-syntax">][</span><span class="identifier-syntax">n</span><span class="plain-syntax">] !=</span>
<span class="plain-syntax">                                </span><span class="identifier-syntax">vt</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">modal_auxiliary_usage</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">][</span><span class="identifier-syntax">s</span><span class="plain-syntax">][</span><span class="identifier-syntax">p</span><span class="plain-syntax">][</span><span class="identifier-syntax">n</span><span class="plain-syntax">]) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                        }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. </b>The following prints out a tidy form of a verb conjugation table:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Conjugation::write</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">Conjugation::write</span></span>:<br/><a href="3-vc.html#SP16">&#167;16</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vc</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"Infinitive: %A / Present participle: %A / Past participle: %A^"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infinitive</span><span class="plain-syntax">), &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">present_participle</span><span class="plain-syntax">), &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">past_participle</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">voice_count</span><span class="plain-syntax"> = </span><span class="constant-syntax">2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">WordAssemblages::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">PASSIVE_VOICE</span><span class="plain-syntax">].</span><span class="element-syntax">to_be_auxiliary</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">voice_count</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">voice</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">voice</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">voice_count</span><span class="plain-syntax">; </span><span class="identifier-syntax">voice</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">sense</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">sense</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_SENSES</span><span class="plain-syntax">; </span><span class="identifier-syntax">sense</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">voice</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"Active "</span><span class="plain-syntax">); </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"Passive "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">sense</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"positive^"</span><span class="plain-syntax">); </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"negative^"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">tense</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">tense</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_TENSES</span><span class="plain-syntax">; </span><span class="identifier-syntax">tense</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"Tense %d: "</span><span class="plain-syntax">, </span><span class="identifier-syntax">tense</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">person</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">n</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">n</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_NUMBERS</span><span class="plain-syntax">; </span><span class="identifier-syntax">n</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">p</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">p</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_PERSONS</span><span class="plain-syntax">; </span><span class="identifier-syntax">p</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">                        </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">wa</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">voice</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                            </span><span class="identifier-syntax">wa</span><span class="plain-syntax"> = &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">ACTIVE_VOICE</span><span class="plain-syntax">].</span><span class="element-syntax">vc_text</span><span class="plain-syntax">[</span><span class="identifier-syntax">tense</span><span class="plain-syntax">][</span><span class="identifier-syntax">sense</span><span class="plain-syntax">][</span><span class="identifier-syntax">p</span><span class="plain-syntax">][</span><span class="identifier-syntax">n</span><span class="plain-syntax">]);</span>
<span class="plain-syntax">                        </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">                            </span><span class="identifier-syntax">wa</span><span class="plain-syntax"> = &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">PASSIVE_VOICE</span><span class="plain-syntax">].</span><span class="element-syntax">vc_text</span><span class="plain-syntax">[</span><span class="identifier-syntax">tense</span><span class="plain-syntax">][</span><span class="identifier-syntax">sense</span><span class="plain-syntax">][</span><span class="identifier-syntax">p</span><span class="plain-syntax">][</span><span class="identifier-syntax">n</span><span class="plain-syntax">]);</span>
<span class="plain-syntax">                        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">person</span><span class="plain-syntax">++ &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" / "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">WordAssemblages::nonempty</span><span class="plain-syntax">(*</span><span class="identifier-syntax">wa</span><span class="plain-syntax">)) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%A"</span><span class="plain-syntax">, </span><span class="identifier-syntax">wa</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"--"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    }</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"^"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">WordAssemblages::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">PASSIVE_VOICE</span><span class="plain-syntax">].</span><span class="element-syntax">to_be_auxiliary</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"Form passive as to be + %A\n"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">PASSIVE_VOICE</span><span class="plain-syntax">].</span><span class="element-syntax">to_be_auxiliary</span><span class="plain-syntax">));</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. Making conjugations.</b>The following will make more sense if read alongside the examples in "English
Inflections", which explains the format in full.
</p>

<p class="commentary">The crucial early step here is <a href="3-vc.html#SP7" class="internal">Conjugation::follow_instructions</a>, which has
two tasks to perform: it works out the numbered verb forms, and it chooses
which tabulation will be used. Verb form number 0 is always the base text,
and subsequent numbers include some which are universal across all verbs
(these have <span class="extract"><span class="extract-syntax">*_FORM_TYPE</span></span> constants), and others which vary from one
conjugation to another.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="function-syntax">Conjugation::conjugate</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">Conjugation::conjugate</span></span>:<br/><a href="3-vc.html#SP8_4">&#167;8.4</a>, <a href="3-vc.html#SP16">&#167;16</a>, <a href="3-vc.html#SP17">&#167;17</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">base_text</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">NATURAL_LANGUAGE_WORDS_TYPE</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nl</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-vc.html#SP6" class="function-link"><span class="function-syntax">Conjugation::conjugate_with_overrides</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">base_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">nl</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="function-syntax">Conjugation::conjugate_with_overrides</span><span class="plain-syntax">(</span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">base_text</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">overrides</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">no_overrides</span><span class="plain-syntax">, </span><span class="identifier-syntax">NATURAL_LANGUAGE_WORDS_TYPE</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nl</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">nl</span><span class="plain-syntax"> = </span><a href="4-dl.html#SP1" class="function-link"><span class="function-syntax">DefaultLanguage::get</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">nl</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">WordAssemblages::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">base_text</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"No base text for verb conjugation"</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="constant-syntax">MAX_FORM_TYPES</span><span class="plain-syntax">+1];</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP6_1" class="named-paragraph-link"><span class="named-paragraph">Initialise all verb forms to the base text</span><span class="named-paragraph-number">6.1</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">n</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">, </span><span class="identifier-syntax">aux_len</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">avo_flag</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">niv_flag</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">nonterminal</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tabulation</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><a href="3-vc.html#SP7" class="function-link"><span class="function-syntax">Conjugation::follow_instructions</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">n</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">aux_len</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">avo_flag</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">niv_flag</span><span class="plain-syntax">, </span><span class="identifier-syntax">nl</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP6_2" class="named-paragraph-link"><span class="named-paragraph">Override any verb forms with supplied irregularities</span><span class="named-paragraph-number">6.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP6_3" class="named-paragraph-link"><span class="named-paragraph">Use the verb forms and the tabulation to make the conjugation</span><span class="named-paragraph-number">6.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6_1" class="paragraph-anchor"></a><b>&#167;6.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Initialise all verb forms to the base text</span><span class="named-paragraph-number">6.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">k</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">k</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">k</span><span class="plain-syntax">&lt;=</span><span class="constant-syntax">MAX_FORM_TYPES</span><span class="plain-syntax">; </span><span class="identifier-syntax">k</span><span class="plain-syntax">++) </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="identifier-syntax">k</span><span class="plain-syntax">] = </span><span class="identifier-syntax">base_text</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_2" class="paragraph-anchor"></a><b>&#167;6.2. </b>This feature is provided so that English verb definitions can override the
usual grammatical rules, which enables us to create new irregular verbs.
For example, Inform will by default make the past participle "blended" out
of the verb "to blend", but a definition like
</p>

<blockquote>
    <p>To blend (I blend, he blends, it is blent) ...</p>
</blockquote>

<p class="commentary">will cause "blent" to override "blended" in the <span class="extract"><span class="extract-syntax">PAST_PARTICIPLE_FORM_TYPE</span></span>.
(Philip Larkin's poem "Church Going" uses "blent", but I've never seen
anybody else try this one on.)
</p>

<p class="commentary">Note that verb form 0 can't be overridden: that was the base text.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Override any verb forms with supplied irregularities</span><span class="named-paragraph-number">6.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">k</span><span class="plain-syntax">=1; </span><span class="identifier-syntax">k</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">no_overrides</span><span class="plain-syntax">; </span><span class="identifier-syntax">k</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">WordAssemblages::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">overrides</span><span class="plain-syntax">[</span><span class="identifier-syntax">k</span><span class="plain-syntax">]))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="identifier-syntax">k</span><span class="plain-syntax">] = </span><span class="identifier-syntax">overrides</span><span class="plain-syntax">[</span><span class="identifier-syntax">k</span><span class="plain-syntax">];</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_3" class="paragraph-anchor"></a><b>&#167;6.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Use the verb forms and the tabulation to make the conjugation</span><span class="named-paragraph-number">6.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vc</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">LINGUISTICS_MODULE</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">vc_conjugates</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infinitive</span><span class="plain-syntax"> = </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="constant-syntax">INFINITIVE_FORM_TYPE</span><span class="plain-syntax">];</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">present_participle</span><span class="plain-syntax"> = </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="constant-syntax">PRESENT_PARTICIPLE_FORM_TYPE</span><span class="plain-syntax">];</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">past_participle</span><span class="plain-syntax"> = </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="constant-syntax">PAST_PARTICIPLE_FORM_TYPE</span><span class="plain-syntax">];</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">defined_in</span><span class="plain-syntax"> = </span><span class="identifier-syntax">nl</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">auxiliary_only</span><span class="plain-syntax"> = </span><span class="identifier-syntax">avo_flag</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">instance_of_verb</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">niv_flag</span><span class="plain-syntax">)?</span><span class="identifier-syntax">FALSE:TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">VC_COMPILATION_INFLECTIONS_CALLBACK</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">VC_COMPILATION_INFLECTIONS_CALLBACK</span><span class="plain-syntax">(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">endif</span>

<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP6_3_1" class="named-paragraph-link"><span class="named-paragraph">Start by blanking out all the passive and active slots</span><span class="named-paragraph-number">6.3.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP6_3_2" class="named-paragraph-link"><span class="named-paragraph">Work through the supplied tabulation, filling in slots as directed</span><span class="named-paragraph-number">6.3.2</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">vc</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_3_1" class="paragraph-anchor"></a><b>&#167;6.3.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Start by blanking out all the passive and active slots</span><span class="named-paragraph-number">6.3.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">ACTIVE_VOICE</span><span class="plain-syntax">].</span><span class="element-syntax">to_be_auxiliary</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAssemblages::lit_0</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">PASSIVE_VOICE</span><span class="plain-syntax">].</span><span class="element-syntax">to_be_auxiliary</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAssemblages::lit_0</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">t</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">t</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_TENSES</span><span class="plain-syntax">; </span><span class="identifier-syntax">t</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">s</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">s</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_SENSES</span><span class="plain-syntax">; </span><span class="identifier-syntax">s</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">n</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">n</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_NUMBERS</span><span class="plain-syntax">; </span><span class="identifier-syntax">n</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">p</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">p</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_PERSONS</span><span class="plain-syntax">; </span><span class="identifier-syntax">p</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">ACTIVE_VOICE</span><span class="plain-syntax">].</span><span class="element-syntax">vc_text</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">][</span><span class="identifier-syntax">s</span><span class="plain-syntax">][</span><span class="identifier-syntax">p</span><span class="plain-syntax">][</span><span class="identifier-syntax">n</span><span class="plain-syntax">] =</span>
<span class="plain-syntax">                        </span><span class="identifier-syntax">WordAssemblages::lit_0</span><span class="plain-syntax">();</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">PASSIVE_VOICE</span><span class="plain-syntax">].</span><span class="element-syntax">vc_text</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">][</span><span class="identifier-syntax">s</span><span class="plain-syntax">][</span><span class="identifier-syntax">p</span><span class="plain-syntax">][</span><span class="identifier-syntax">n</span><span class="plain-syntax">] =</span>
<span class="plain-syntax">                        </span><span class="identifier-syntax">WordAssemblages::lit_0</span><span class="plain-syntax">();</span>
<span class="plain-syntax">                }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP6_3">&#167;6.3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_3_2" class="paragraph-anchor"></a><b>&#167;6.3.2. </b>A tabulation is a sort of program laying out what to put in which slots,
active or passive. Each production is a step in this program, and it consists
of a "selector" followed by a "line". For example, the production:
</p>

<pre class="Preform-displayed-code all-displayed-code code-font">
<span class="Preform-plain-syntax">    </span><span class="Preform-constant-syntax">a3</span><span class="Preform-plain-syntax"> </span><span class="Preform-reserved-syntax">(</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">t1</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">avoir</span><span class="Preform-plain-syntax"> </span><span class="Preform-reserved-syntax">)</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">3+*</span>
</pre>
<p class="commentary">contains six tokens; the selector is <span class="extract"><span class="Preform-extract-syntax">a3</span></span>, and the line is made up from the
rest. (The selector is always just a single token.)
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Work through the supplied tabulation, filling in slots as directed</span><span class="named-paragraph-number">6.3.2</span></span><span class="Preform-comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">production_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pl</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pl</span><span class="plain-syntax"> = </span><span class="identifier-syntax">tabulation</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pl</span><span class="plain-syntax">; </span><span class="identifier-syntax">pl</span><span class="plain-syntax">; </span><span class="identifier-syntax">pl</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pl</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pl</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">nl</span><span class="plain-syntax"> == </span><span class="identifier-syntax">pl</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">definition_language</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">production</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pl</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pr</span><span class="plain-syntax">; </span><span class="identifier-syntax">pr</span><span class="plain-syntax">; </span><span class="identifier-syntax">pr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pr</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pr</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">ptoken</span><span class="plain-syntax"> *</span><span class="identifier-syntax">selector</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pr</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pt</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">ptoken</span><span class="plain-syntax"> *</span><span class="identifier-syntax">line</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">selector</span><span class="plain-syntax">)?(</span><span class="identifier-syntax">selector</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pt</span><span class="plain-syntax">):</span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">selector</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">selector</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ptoken_category</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FIXED_WORD_PTC</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">                    (</span><span class="identifier-syntax">line</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                    </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP6_3_2_1" class="named-paragraph-link"><span class="named-paragraph">Apply the given tabulation line to the slots selected</span><span class="named-paragraph-number">6.3.2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">                } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><a href="3-vc.html#SP15" class="function-link"><span class="function-syntax">Conjugation::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">base_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">tabulation</span><span class="plain-syntax">, </span><span class="identifier-syntax">pr</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                    </span><span class="string-syntax">"tabulation row doesn't consist of a selector and then text"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP6_3">&#167;6.3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_3_2_1" class="paragraph-anchor"></a><b>&#167;6.3.2.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Apply the given tabulation line to the slots selected</span><span class="named-paragraph-number">6.3.2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">active_set</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NOT_APPLICABLE</span><span class="plain-syntax">, </span><span class="identifier-syntax">tense_set</span><span class="plain-syntax"> = -1, </span><span class="identifier-syntax">sense_set</span><span class="plain-syntax"> = -1, </span><span class="identifier-syntax">set_tba</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP6_3_2_1_3" class="named-paragraph-link"><span class="named-paragraph">Parse the slot selector</span><span class="named-paragraph-number">6.3.2.1.3</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">set_tba</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">PASSIVE_VOICE</span><span class="plain-syntax">].</span><span class="element-syntax">to_be_auxiliary</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><a href="3-vc.html#SP8" class="function-link"><span class="function-syntax">Conjugation::merge</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">line</span><span class="plain-syntax">, </span><span class="constant-syntax">POSITIVE_SENSE</span><span class="plain-syntax">, </span><span class="constant-syntax">IS_TENSE</span><span class="plain-syntax">, </span><span class="constant-syntax">FIRST_PERSON</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="constant-syntax">SINGULAR_NUMBER</span><span class="plain-syntax">, </span><span class="constant-syntax">MAX_FORM_TYPES</span><span class="plain-syntax">+1, </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">, </span><span class="identifier-syntax">nl</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">tense</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">tense</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_TENSES</span><span class="plain-syntax">; </span><span class="identifier-syntax">tense</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">sense</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">sense</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_SENSES</span><span class="plain-syntax">; </span><span class="identifier-syntax">sense</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">n</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">n</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_NUMBERS</span><span class="plain-syntax">; </span><span class="identifier-syntax">n</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">p</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">p</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">NO_KNOWN_PERSONS</span><span class="plain-syntax">; </span><span class="identifier-syntax">p</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">sense_set</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">sense</span><span class="plain-syntax"> != </span><span class="identifier-syntax">sense_set</span><span class="plain-syntax">)) </span><span class="reserved-syntax">continue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">tense_set</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">tense</span><span class="plain-syntax"> != </span><span class="identifier-syntax">tense_set</span><span class="plain-syntax">)) </span><span class="reserved-syntax">continue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">active_set</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP6_3_2_1_1" class="named-paragraph-link"><span class="named-paragraph">Apply to the active voice</span><span class="named-paragraph-number">6.3.2.1.1</span></a></span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP6_3_2_1_2" class="named-paragraph-link"><span class="named-paragraph">Apply to the passive voice</span><span class="named-paragraph-number">6.3.2.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">                }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP6_3_2">&#167;6.3.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_3_2_1_1" class="paragraph-anchor"></a><b>&#167;6.3.2.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Apply to the active voice</span><span class="named-paragraph-number">6.3.2.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">ACTIVE_VOICE</span><span class="plain-syntax">].</span><span class="element-syntax">vc_text</span><span class="plain-syntax">[</span><span class="identifier-syntax">tense</span><span class="plain-syntax">][</span><span class="identifier-syntax">sense</span><span class="plain-syntax">][</span><span class="identifier-syntax">p</span><span class="plain-syntax">][</span><span class="identifier-syntax">n</span><span class="plain-syntax">] =</span>
<span class="plain-syntax">        </span><a href="3-vc.html#SP8" class="function-link"><span class="function-syntax">Conjugation::merge</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">line</span><span class="plain-syntax">, </span><span class="identifier-syntax">sense</span><span class="plain-syntax">, </span><span class="identifier-syntax">tense</span><span class="plain-syntax">, </span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">n</span><span class="plain-syntax">, </span><span class="constant-syntax">MAX_FORM_TYPES</span><span class="plain-syntax">+1, </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">, </span><span class="identifier-syntax">nl</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">ACTIVE_VOICE</span><span class="plain-syntax">].</span><span class="element-syntax">modal_auxiliary_usage</span><span class="plain-syntax">[</span><span class="identifier-syntax">tense</span><span class="plain-syntax">][</span><span class="identifier-syntax">sense</span><span class="plain-syntax">][</span><span class="identifier-syntax">p</span><span class="plain-syntax">][</span><span class="identifier-syntax">n</span><span class="plain-syntax">]));</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP6_3_2_1">&#167;6.3.2.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_3_2_1_2" class="paragraph-anchor"></a><b>&#167;6.3.2.1.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Apply to the passive voice</span><span class="named-paragraph-number">6.3.2.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">PASSIVE_VOICE</span><span class="plain-syntax">].</span><span class="element-syntax">vc_text</span><span class="plain-syntax">[</span><span class="identifier-syntax">tense</span><span class="plain-syntax">][</span><span class="identifier-syntax">sense</span><span class="plain-syntax">][</span><span class="identifier-syntax">p</span><span class="plain-syntax">][</span><span class="identifier-syntax">n</span><span class="plain-syntax">] =</span>
<span class="plain-syntax">        </span><a href="3-vc.html#SP8" class="function-link"><span class="function-syntax">Conjugation::merge</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">line</span><span class="plain-syntax">, </span><span class="identifier-syntax">sense</span><span class="plain-syntax">, </span><span class="identifier-syntax">tense</span><span class="plain-syntax">, </span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">n</span><span class="plain-syntax">, </span><span class="constant-syntax">MAX_FORM_TYPES</span><span class="plain-syntax">+1, </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">, </span><span class="identifier-syntax">nl</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">PASSIVE_VOICE</span><span class="plain-syntax">].</span><span class="element-syntax">modal_auxiliary_usage</span><span class="plain-syntax">[</span><span class="identifier-syntax">tense</span><span class="plain-syntax">][</span><span class="identifier-syntax">sense</span><span class="plain-syntax">][</span><span class="identifier-syntax">p</span><span class="plain-syntax">][</span><span class="identifier-syntax">n</span><span class="plain-syntax">]));</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP6_3_2_1">&#167;6.3.2.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_3_2_1_3" class="paragraph-anchor"></a><b>&#167;6.3.2.1.3. </b>The selector tells us which tense(s), sense(s) and voice(s) to apply the
line to; <span class="extract"><span class="extract-syntax">a3</span></span>, for example, means active voice, tense 3, in both positive
and negative senses.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse the slot selector</span><span class="named-paragraph-number">6.3.2.1.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">vocabulary_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ve</span><span class="plain-syntax"> = </span><span class="identifier-syntax">selector</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ve_pt</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Vocabulary::get_exemplar</span><span class="plain-syntax">(</span><span class="identifier-syntax">ve</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[0] == </span><span class="character-syntax">'a'</span><span class="plain-syntax">) </span><span class="identifier-syntax">active_set</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[0] == </span><span class="character-syntax">'p'</span><span class="plain-syntax">) </span><span class="identifier-syntax">active_set</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">active_set</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NOT_APPLICABLE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="3-vc.html#SP15" class="function-link"><span class="function-syntax">Conjugation::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">base_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">tabulation</span><span class="plain-syntax">, </span><span class="identifier-syntax">pr</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"tabulation row doesn't begin with 'a' or 'p'"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Characters::isdigit</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">at</span><span class="plain-syntax">])) { </span><span class="identifier-syntax">tense_set</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">int</span><span class="plain-syntax">) (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">at</span><span class="plain-syntax">++]-</span><span class="character-syntax">'1'</span><span class="plain-syntax">); }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">at</span><span class="plain-syntax">] == </span><span class="character-syntax">'+'</span><span class="plain-syntax">) { </span><span class="identifier-syntax">sense_set</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">; </span><span class="identifier-syntax">at</span><span class="plain-syntax">++; }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">at</span><span class="plain-syntax">] == </span><span class="character-syntax">'-'</span><span class="plain-syntax">) { </span><span class="identifier-syntax">sense_set</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="identifier-syntax">at</span><span class="plain-syntax">++; }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">at</span><span class="plain-syntax">] == </span><span class="character-syntax">'*'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">tense_set</span><span class="plain-syntax"> == -1) &amp;&amp; (</span><span class="identifier-syntax">active_set</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">set_tba</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">; </span><span class="identifier-syntax">at</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">at</span><span class="plain-syntax">] != </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">"The selector here is: &lt;%w&gt;\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">p</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="3-vc.html#SP15" class="function-link"><span class="function-syntax">Conjugation::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">base_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">tabulation</span><span class="plain-syntax">, </span><span class="identifier-syntax">pr</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"unrecognised selector in tabulation row"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP6_3_2_1">&#167;6.3.2.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. Follow instructions.</b>That completes the top level of the routine, but it depended on two major
sub-steps: a preliminary pass called <span class="extract"><span class="extract-syntax">Conjugation::follow_instructions</span></span> and
a routine to deal with the final results called <span class="extract"><span class="extract-syntax">Conjugation::merge</span></span>.
</p>

<p class="commentary">Here's the first of these. Note that the routine indirects through three main
nonterminals; it always starts with <span class="extract"><span class="extract-syntax">&lt;verb-conjugation-instructions&gt;</span></span> and
uses this to choose a "conjugation" nonterminal. It then chugs through
the conjugation, which ends by choosing a "tabulation". For example, in
English, the base text "do" passes through <span class="extract"><span class="extract-syntax">&lt;verb-conjugation-instructions&gt;</span></span>,
which chooses the conjugation <span class="extract"><span class="extract-syntax">&lt;to-do-conjugation&gt;</span></span>, which in turn sets some
participles and then chooses the tabulation <span class="extract"><span class="extract-syntax">&lt;to-do-tabulation&gt;</span></span>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">nonterminal</span><span class="plain-syntax"> *</span><span class="function-syntax">Conjugation::follow_instructions</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">Conjugation::follow_instructions</span></span>:<br/><a href="3-vc.html#SP6">&#167;6</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">highest_form_written</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">aux_len</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">avo_flag</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">niv_flag</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">NATURAL_LANGUAGE_WORDS_TYPE</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nl</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">nonterminal</span><span class="plain-syntax"> *</span><span class="identifier-syntax">instructions_nt</span><span class="plain-syntax"> = </span><span class="function-syntax">&lt;verb-conjugation-instructions&gt;</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">nonterminal</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tabulation_nt</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">conjugation_nt</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    *</span><span class="identifier-syntax">highest_form_written</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    *</span><span class="identifier-syntax">aux_len</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">; *</span><span class="identifier-syntax">avo_flag</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">; *</span><span class="identifier-syntax">niv_flag</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP7_1" class="named-paragraph-link"><span class="named-paragraph">Pattern match on the base text to decide which conjugation to use</span><span class="named-paragraph-number">7.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">conjugation_nt</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="3-vc.html#SP15" class="function-link"><span class="function-syntax">Conjugation::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[0], </span><span class="identifier-syntax">instructions_nt</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"the instructions here failed to choose a conjugation"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP7_2" class="named-paragraph-link"><span class="named-paragraph">Process the conjugation and determine the tabulation</span><span class="named-paragraph-number">7.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tabulation_nt</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="3-vc.html#SP15" class="function-link"><span class="function-syntax">Conjugation::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[0], </span><span class="identifier-syntax">conjugation_nt</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"the conjugation here failed to choose a tabulation"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">tabulation_nt</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7_1" class="paragraph-anchor"></a><b>&#167;7.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Pattern match on the base text to decide which conjugation to use</span><span class="named-paragraph-number">7.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">vocabulary_entry</span><span class="plain-syntax"> **</span><span class="identifier-syntax">base_text_words</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">base_text_word_count</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WordAssemblages::as_array</span><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="constant-syntax">BASE_FORM_TYPE</span><span class="plain-syntax">]), &amp;</span><span class="identifier-syntax">base_text_words</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">base_text_word_count</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">production_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pl</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pl</span><span class="plain-syntax"> = </span><span class="identifier-syntax">instructions_nt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pl</span><span class="plain-syntax">; </span><span class="identifier-syntax">pl</span><span class="plain-syntax">; </span><span class="identifier-syntax">pl</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pl</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pl</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">nl</span><span class="plain-syntax"> == </span><span class="identifier-syntax">pl</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">definition_language</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">production</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pr</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pl</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pr</span><span class="plain-syntax">; </span><span class="identifier-syntax">pr</span><span class="plain-syntax">; </span><span class="identifier-syntax">pr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pr</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pr</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP7_1_1" class="named-paragraph-link"><span class="named-paragraph">Try to match the base text against this production</span><span class="named-paragraph-number">7.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP7">&#167;7</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP7_1_1" class="paragraph-anchor"></a><b>&#167;7.1.1. </b>Each production in this language's <span class="extract"><span class="extract-syntax">&lt;verb-conjugation-instructions&gt;</span></span> grammar
consists of a (possibly empty) pattern to match, followed by the name of a
nonterminal to use as the conjugation if it matches. For example, in
</p>

<pre class="Preform-displayed-code all-displayed-code code-font">
<span class="Preform-plain-syntax">    </span><span class="Preform-constant-syntax">-querir</span><span class="Preform-plain-syntax"> </span><span class="Preform-function-syntax">&lt;fr-querir-conjugation&gt;</span>
</pre>
<p class="commentary">the pattern part is a single token, <span class="extract"><span class="Preform-extract-syntax">-querir</span></span>, which matches if the base text
is a single word whose last six characters are "querir". A more complicated
case is:
</p>

<pre class="Preform-displayed-code all-displayed-code code-font">
<span class="Preform-plain-syntax">    </span><span class="Preform-constant-syntax">be</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">able</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">to</span><span class="Preform-plain-syntax"> </span><span class="Preform-reserved-syntax">...</span><span class="Preform-plain-syntax"> </span><span class="Preform-function-syntax">&lt;to-be-able-to-auxiliary&gt;</span>
</pre>
<p class="commentary">Here the wildcard <span class="extract"><span class="Preform-extract-syntax">...</span></span> matches one or more words, and the "auxiliary
infinitive" form is set to the part matched by <span class="extract"><span class="Preform-extract-syntax">...</span></span>: for example,
"be able to see" matches with auxiliary infinitive "see".
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Try to match the base text against this production</span><span class="named-paragraph-number">7.1.1</span></span><span class="Preform-comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">ptoken</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pt</span><span class="plain-syntax">, *</span><span class="identifier-syntax">last</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">len</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">malformed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pt</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pr</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pt</span><span class="plain-syntax">; </span><span class="identifier-syntax">pt</span><span class="plain-syntax">; </span><span class="identifier-syntax">pt</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pt</span><span class="plain-syntax">) { </span><span class="identifier-syntax">last</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pt</span><span class="plain-syntax">; </span><span class="identifier-syntax">len</span><span class="plain-syntax">++; }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">len</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">1</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">last</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ptoken_category</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NONTERMINAL_PTC</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">conjugation_nt</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) { </span><span class="comment-syntax"> i.e., if we have not yet chosen a conjugation</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">failed_to_match</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">wildcard_from</span><span class="plain-syntax"> = -1;</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP7_1_1_1" class="named-paragraph-link"><span class="named-paragraph">Try to match the base text against the pattern part of the production</span><span class="named-paragraph-number">7.1.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">failed_to_match</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">conjugation_nt</span><span class="plain-syntax"> = </span><span class="identifier-syntax">last</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">nt_pt</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="constant-syntax">ADJOINT_INFINITIVE_FORM_TYPE</span><span class="plain-syntax">] = </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="constant-syntax">BASE_FORM_TYPE</span><span class="plain-syntax">];</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">wildcard_from</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">WordAssemblages::truncate</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                        &amp;(</span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="constant-syntax">ADJOINT_INFINITIVE_FORM_TYPE</span><span class="plain-syntax">]), </span><span class="identifier-syntax">wildcard_from</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                *</span><span class="identifier-syntax">aux_len</span><span class="plain-syntax"> = </span><span class="identifier-syntax">wildcard_from</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">malformed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">malformed</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="3-vc.html#SP15" class="function-link"><span class="function-syntax">Conjugation::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="constant-syntax">BASE_FORM_TYPE</span><span class="plain-syntax">], </span><span class="function-syntax">&lt;verb-conjugation-instructions&gt;</span><span class="plain-syntax">, </span><span class="identifier-syntax">pr</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"malformed line"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP7_1">&#167;7.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP7_1_1_1" class="paragraph-anchor"></a><b>&#167;7.1.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Try to match the base text against the pattern part of the production</span><span class="named-paragraph-number">7.1.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">word_count</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pt</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pr</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pt</span><span class="plain-syntax">; ((</span><span class="identifier-syntax">pt</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">pt</span><span class="plain-syntax"> != </span><span class="identifier-syntax">last</span><span class="plain-syntax">)); </span><span class="identifier-syntax">pt</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pt</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ptoken_category</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FIXED_WORD_PTC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">word_count</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">base_text_word_count</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">                (</span><a href="3-vc.html#SP14" class="function-link"><span class="function-syntax">Conjugation::compare_ve_with_tails</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">base_text_words</span><span class="plain-syntax">[</span><span class="identifier-syntax">word_count</span><span class="plain-syntax">], </span><span class="identifier-syntax">pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ve_pt</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">word_count</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">failed_to_match</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ptoken_category</span><span class="plain-syntax"> == </span><span class="identifier-syntax">MULTIPLE_WILDCARD_PTC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">wildcard_from</span><span class="plain-syntax"> = </span><span class="identifier-syntax">word_count</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">base_text_word_count</span><span class="plain-syntax"> &lt;= </span><span class="identifier-syntax">word_count</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">failed_to_match</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">; </span><span class="comment-syntax"> must match at least one word</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">malformed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">wildcard_from</span><span class="plain-syntax"> == -1) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">word_count</span><span class="plain-syntax"> != </span><span class="identifier-syntax">base_text_word_count</span><span class="plain-syntax">) </span><span class="identifier-syntax">failed_to_match</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">wildcard_from</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP7_1_1">&#167;7.1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP7_2" class="paragraph-anchor"></a><b>&#167;7.2. </b>In a conjugation, productions have two possible forms: either just a single
nonterminal, which usually identifies the tabulation, or a number followed by some
tokens.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Process the conjugation and determine the tabulation</span><span class="named-paragraph-number">7.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">production_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pl</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pl</span><span class="plain-syntax"> = </span><span class="identifier-syntax">conjugation_nt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pl</span><span class="plain-syntax">; </span><span class="identifier-syntax">pl</span><span class="plain-syntax">; </span><span class="identifier-syntax">pl</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pl</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pl</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">nl</span><span class="plain-syntax"> == </span><span class="identifier-syntax">pl</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">definition_language</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">production</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pr</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pl</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pr</span><span class="plain-syntax">; </span><span class="identifier-syntax">pr</span><span class="plain-syntax">; </span><span class="identifier-syntax">pr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pr</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pr</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">ptoken</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pt</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">len</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">malformed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pt</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pr</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pt</span><span class="plain-syntax">; </span><span class="identifier-syntax">pt</span><span class="plain-syntax">; </span><span class="identifier-syntax">pt</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pt</span><span class="plain-syntax">) </span><span class="identifier-syntax">len</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">len</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">1</span><span class="plain-syntax">:</span>
<span class="plain-syntax">                        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pr</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ptoken_category</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NONTERMINAL_PTC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pr</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">nt_pt</span><span class="plain-syntax"> == </span><span class="function-syntax">&lt;auxiliary-verb-only&gt;</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                                *</span><span class="identifier-syntax">avo_flag</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pr</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">nt_pt</span><span class="plain-syntax"> == </span><span class="function-syntax">&lt;not-instance-of-verb-at-run-time&gt;</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                                *</span><span class="identifier-syntax">niv_flag</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                            </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">                                </span><span class="identifier-syntax">tabulation_nt</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pr</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">nt_pt</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">malformed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                        </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">2</span><span class="plain-syntax">:</span>
<span class="plain-syntax">                        </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP7_2_1" class="named-paragraph-link"><span class="named-paragraph">Set a verb form from the conjugation line</span><span class="named-paragraph-number">7.2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">                        </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">default:</span><span class="plain-syntax"> </span><span class="identifier-syntax">malformed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                }</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">malformed</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                    </span><a href="3-vc.html#SP15" class="function-link"><span class="function-syntax">Conjugation::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="constant-syntax">BASE_FORM_TYPE</span><span class="plain-syntax">], </span><span class="identifier-syntax">conjugation_nt</span><span class="plain-syntax">, </span><span class="identifier-syntax">pr</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                        </span><span class="string-syntax">"malformed line"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP7">&#167;7</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP7_2_1" class="paragraph-anchor"></a><b>&#167;7.2.1. </b>So here we check the more interesting case. The number identifies which
verb form to set, and the token which follows it provides the content. For
example:
</p>

<p class="commentary"><span class="extract"><span class="extract-syntax">2 having</span></span> set to the literal text "having"
<span class="extract"><span class="extract-syntax">3 1+ed</span></span> set to verb form 1 with "ed" suffixed
<span class="extract"><span class="extract-syntax">3 &lt;en-trie-past-participle&gt;</span></span> run this trie on the base text and take the result
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Set a verb form from the conjugation line</span><span class="named-paragraph-number">7.2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">ptoken</span><span class="plain-syntax"> *</span><span class="identifier-syntax">number_token</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pr</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pt</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ptoken</span><span class="plain-syntax"> *</span><span class="identifier-syntax">content_token</span><span class="plain-syntax"> = </span><span class="identifier-syntax">number_token</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pt</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">n</span><span class="plain-syntax"> = </span><a href="3-vc.html#SP11" class="function-link"><span class="function-syntax">Conjugation::ptoken_to_verb_form_number</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">number_token</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">n</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">n</span><span class="plain-syntax"> &gt; *</span><span class="identifier-syntax">highest_form_written</span><span class="plain-syntax">) { *</span><span class="identifier-syntax">highest_form_written</span><span class="plain-syntax"> = </span><span class="identifier-syntax">n</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">content_token</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ptoken_category</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NONTERMINAL_PTC</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="identifier-syntax">n</span><span class="plain-syntax">] =</span>
<span class="plain-syntax">                </span><a href="2-tai.html#SP3" class="function-link"><span class="function-syntax">Inflect::first_word</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="constant-syntax">BASE_FORM_TYPE</span><span class="plain-syntax">],</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">PreformUtilities::define_trie</span><span class="plain-syntax">(</span><span class="identifier-syntax">content_token</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">nt_pt</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                        </span><span class="identifier-syntax">TRIE_END</span><span class="plain-syntax">, </span><a href="4-dl.html#SP1" class="function-link"><span class="function-syntax">DefaultLanguage::get</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">nl</span><span class="plain-syntax">)));</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">content_token</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ptoken_category</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FIXED_WORD_PTC</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="identifier-syntax">n</span><span class="plain-syntax">] =</span>
<span class="plain-syntax">                </span><a href="3-vc.html#SP9" class="function-link"><span class="function-syntax">Conjugation::expand_with_endings</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">content_token</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ve_pt</span><span class="plain-syntax">, </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">malformed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">malformed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP7_2">&#167;7.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. Merge verb material.</b>Now the final main step. <span class="extract"><span class="extract-syntax">row</span></span> points to a list of ptokens containing text,
and we have to copy that text into a word assemblage and return it.
</p>

<p class="commentary">In theory that's a one-line routine, but it's made complicated by the number
of special syntaxes which can go into the row of text. For example, if <span class="extract"><span class="extract-syntax">row</span></span>
is only
</p>

<pre class="Preform-displayed-code all-displayed-code code-font">
<span class="Preform-plain-syntax">    </span><span class="Preform-constant-syntax">will</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">not</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">do</span>
</pre>
<p class="commentary">then the word assemblage comes out to just "will not do"; but if it is
</p>

<pre class="Preform-displayed-code all-displayed-code code-font">
<span class="Preform-plain-syntax">    </span><span class="Preform-reserved-syntax">(</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">t1</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">auxiliary-have</span><span class="Preform-plain-syntax"> </span><span class="Preform-reserved-syntax">)</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">done</span>
</pre>
<p class="commentary">then we consult tense 1 (present) of the verb "auxiliary-have", extract
the relevant slot, then append "done". (This might produce "have done"
or "has done" or "haven't done" or "hasn't done", depending on the
current sense and person.) We call the business of extracting text from
a different verb's conjugation "lifting".
</p>

<p class="commentary">There are other complications, too. See "English Inflections" for more.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="function-syntax">Conjugation::merge</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">Conjugation::merge</span></span>:<br/><a href="3-vc.html#SP6_3_2_1">&#167;6.3.2.1</a>, <a href="3-vc.html#SP6_3_2_1_1">&#167;6.3.2.1.1</a>, <a href="3-vc.html#SP6_3_2_1_2">&#167;6.3.2.1.2</a>, <a href="3-vc.html#SP8_2">&#167;8.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">ptoken</span><span class="plain-syntax"> *</span><span class="identifier-syntax">row</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">sense</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">tense</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">person</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">num_ingredients</span><span class="plain-syntax">, </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ingredients</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">NATURAL_LANGUAGE_WORDS_TYPE</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nl</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">modal_following</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">modal_following</span><span class="plain-syntax">) { *</span><span class="identifier-syntax">modal_following</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">wa</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAssemblages::lit_0</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">verb_form_to_lift</span><span class="plain-syntax"> = -1;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ptoken</span><span class="plain-syntax"> *</span><span class="identifier-syntax">chunk</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">chunk</span><span class="plain-syntax"> = </span><span class="identifier-syntax">row</span><span class="plain-syntax">; </span><span class="identifier-syntax">chunk</span><span class="plain-syntax">; </span><span class="identifier-syntax">chunk</span><span class="plain-syntax"> = </span><span class="identifier-syntax">chunk</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pt</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP8_5" class="named-paragraph-link"><span class="named-paragraph">A plus-plus-digit indicates auxiliary modal usage</span><span class="named-paragraph-number">8.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP8_3" class="named-paragraph-link"><span class="named-paragraph">A form number followed by a bracketed verb lifts the relevant form</span><span class="named-paragraph-number">8.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP8_4" class="named-paragraph-link"><span class="named-paragraph">A bracketed verb becomes a lift</span><span class="named-paragraph-number">8.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP8_1" class="named-paragraph-link"><span class="named-paragraph">A fixed word is simply added to the result</span><span class="named-paragraph-number">8.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP8_2" class="named-paragraph-link"><span class="named-paragraph">A nonterminal is a table of persons</span><span class="named-paragraph-number">8.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"Error in merge material line"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-vc.html#SP10" class="function-link"><span class="function-syntax">Conjugation::shorten_with_contractions</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">wa</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8_1" class="paragraph-anchor"></a><b>&#167;8.1. </b>To take the easiest case first. If we read a word like <span class="extract"><span class="extract-syntax">trailing</span></span>, we simply
add it. But note that <span class="extract"><span class="extract-syntax">Conjugation::expand_with_endings</span></span> has other tricks up its sleeve,
and might expand <span class="extract"><span class="extract-syntax">3+ed</span></span> to "trailed".
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">A fixed word is simply added to the result</span><span class="named-paragraph-number">8.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">chunk</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ptoken_category</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FIXED_WORD_PTC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">wa</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">wa</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="3-vc.html#SP9" class="function-link"><span class="function-syntax">Conjugation::expand_with_endings</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">chunk</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ve_pt</span><span class="plain-syntax">, </span><span class="identifier-syntax">ingredients</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">continue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_2" class="paragraph-anchor"></a><b>&#167;8.2. </b>If we read a nonterminal name, such as <span class="extract"><span class="extract-syntax">&lt;fr-vivre-present&gt;</span></span>, then this must
be a grammar with six productions, giving the text to use for the six different
persons. We consult <span class="extract"><span class="extract-syntax">person</span></span> and extract the relevant text. For example, if
<span class="extract"><span class="extract-syntax">person</span></span> is 3, we extract "vivons". Note that this material is itself read
in by a recursive use of <span class="extract"><span class="extract-syntax">Conjugation::merge()</span></span>, because this enables it to
make use of the same fancy features we're allowing here.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">A nonterminal is a table of persons</span><span class="named-paragraph-number">8.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">chunk</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ptoken_category</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NONTERMINAL_PTC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">production_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pl</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pl</span><span class="plain-syntax"> = </span><span class="identifier-syntax">chunk</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">nt_pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pl</span><span class="plain-syntax">; </span><span class="identifier-syntax">pl</span><span class="plain-syntax">; </span><span class="identifier-syntax">pl</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pl</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pl</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">production</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pr</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pl</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pr</span><span class="plain-syntax">; </span><span class="identifier-syntax">pr</span><span class="plain-syntax">; </span><span class="identifier-syntax">pr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pr</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pr</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">N</span><span class="plain-syntax"> == </span><span class="identifier-syntax">number</span><span class="plain-syntax">*3 + </span><span class="identifier-syntax">person</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">wa</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">wa</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                        </span><a href="3-vc.html#SP8" class="function-link"><span class="function-syntax">Conjugation::merge</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">pr</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_pt</span><span class="plain-syntax">, </span><span class="identifier-syntax">sense</span><span class="plain-syntax">, </span><span class="identifier-syntax">tense</span><span class="plain-syntax">, </span><span class="identifier-syntax">person</span><span class="plain-syntax">, </span><span class="identifier-syntax">number</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                            </span><span class="identifier-syntax">num_ingredients</span><span class="plain-syntax">, </span><span class="identifier-syntax">ingredients</span><span class="plain-syntax">, </span><span class="identifier-syntax">nl</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">N</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">continue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_3" class="paragraph-anchor"></a><b>&#167;8.3. </b>A number followed by a verb in brackets, like so:
</p>

<pre class="Preform-displayed-code all-displayed-code code-font">
<span class="Preform-plain-syntax">    </span><span class="Preform-constant-syntax">3</span><span class="Preform-plain-syntax"> </span><span class="Preform-reserved-syntax">(</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">avoir</span><span class="Preform-plain-syntax"> </span><span class="Preform-reserved-syntax">)</span>
</pre>
<p class="commentary">expands to verb form 3 of this verb &mdash; the past participle of "avoir", which
is "eu", as it happens. This is a special kind of lift. It isn't actually
performed now; we make a note and carry it out when we reach the brackets,
on the next iteration.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">A form number followed by a bracketed verb lifts the relevant form</span><span class="named-paragraph-number">8.3</span></span><span class="Preform-comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">X</span><span class="plain-syntax"> = </span><a href="3-vc.html#SP11" class="function-link"><span class="function-syntax">Conjugation::ptoken_to_verb_form_number</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">chunk</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">X</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><a href="3-vc.html#SP13" class="function-link"><span class="function-syntax">Conjugation::ptoken_as_bracket</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">chunk</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pt</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">verb_form_to_lift</span><span class="plain-syntax"> = </span><span class="identifier-syntax">X</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">continue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_4" class="paragraph-anchor"></a><b>&#167;8.4. </b>And now the lift takes place. We might at this point have <span class="extract"><span class="extract-syntax">verb_form_to_lift</span></span>
set, in which case we should lift a verb form, or we might not, in which case
we should lift an ordinary usage, such as third-person singular in a particular
tense. A lift can optionally change tense or sense: for example,
</p>

<pre class="Preform-displayed-code all-displayed-code code-font">
<span class="Preform-plain-syntax">    </span><span class="Preform-reserved-syntax">(</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">t1</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">have</span><span class="Preform-plain-syntax"> </span><span class="Preform-reserved-syntax">)</span>
</pre>
<p class="commentary">lifts from the present tense of "to have". If there's no tense indicator,
the tense remains the current one. (It's also possible to change the sense from
positive to negative or vice versa with this, though I can't think of a
language where this would be useful.) Note that, once again, the text of the
infinitive passes through <span class="extract"><span class="Preform-extract-syntax">Conjugation::expand_with_endings</span></span>, so that it can
make use of the numbered verb forms if we want it to.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">A bracketed verb becomes a lift</span><span class="named-paragraph-number">8.4</span></span><span class="Preform-comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-vc.html#SP13" class="function-link"><span class="function-syntax">Conjugation::ptoken_as_bracket</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">chunk</span><span class="plain-syntax">) == </span><span class="constant-syntax">1</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">chunk</span><span class="plain-syntax"> = </span><span class="identifier-syntax">chunk</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pt</span><span class="plain-syntax">; </span><span class="comment-syntax"> move past open bracket</span>

<span class="plain-syntax">        </span><span class="comment-syntax"> if there is a tense/sense indicator, use it, and move forward</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">S</span><span class="plain-syntax"> = -1;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">T</span><span class="plain-syntax"> = </span><a href="3-vc.html#SP12" class="function-link"><span class="function-syntax">Conjugation::ptoken_to_tense_indicator</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">chunk</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">S</span><span class="plain-syntax">) - </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">T</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">chunk</span><span class="plain-syntax"> = </span><span class="identifier-syntax">chunk</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pt</span><span class="plain-syntax">; </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">T</span><span class="plain-syntax"> = </span><span class="identifier-syntax">tense</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">S</span><span class="plain-syntax"> == -1) </span><span class="identifier-syntax">S</span><span class="plain-syntax"> = </span><span class="identifier-syntax">sense</span><span class="plain-syntax">;</span>

<span class="plain-syntax">        </span><span class="comment-syntax"> extract the text of the infinitive</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">verb_lifted</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAssemblages::lit_0</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">while</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">chunk</span><span class="plain-syntax">) &amp;&amp; (</span><a href="3-vc.html#SP13" class="function-link"><span class="function-syntax">Conjugation::ptoken_as_bracket</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">chunk</span><span class="plain-syntax">) != -1)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">verb_lifted</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">verb_lifted</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><a href="3-vc.html#SP9" class="function-link"><span class="function-syntax">Conjugation::expand_with_endings</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">chunk</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ve_pt</span><span class="plain-syntax">, </span><span class="identifier-syntax">ingredients</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">chunk</span><span class="plain-syntax"> = </span><span class="identifier-syntax">chunk</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_pt</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>

<span class="plain-syntax">        </span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">aux</span><span class="plain-syntax"> = </span><a href="3-vc.html#SP2" class="function-link"><span class="function-syntax">Conjugation::find_by_infinitive</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">verb_lifted</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">aux</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">aux</span><span class="plain-syntax"> = </span><a href="3-vc.html#SP6" class="function-link"><span class="function-syntax">Conjugation::conjugate</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">verb_lifted</span><span class="plain-syntax">, </span><span class="identifier-syntax">nl</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">aux</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"can't conjugate lifted verb"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">verb_form_to_lift</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">1</span><span class="plain-syntax">: </span><span class="identifier-syntax">wa</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">wa</span><span class="plain-syntax">, </span><span class="identifier-syntax">aux</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infinitive</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">2</span><span class="plain-syntax">: </span><span class="identifier-syntax">wa</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">wa</span><span class="plain-syntax">, </span><span class="identifier-syntax">aux</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">present_participle</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">3</span><span class="plain-syntax">: </span><span class="identifier-syntax">wa</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">wa</span><span class="plain-syntax">, </span><span class="identifier-syntax">aux</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">past_participle</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> -1: </span><span class="identifier-syntax">wa</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">wa</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">aux</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tabulations</span><span class="plain-syntax">[</span><span class="constant-syntax">ACTIVE_VOICE</span><span class="plain-syntax">].</span><span class="element-syntax">vc_text</span><span class="plain-syntax">[</span><span class="identifier-syntax">T</span><span class="plain-syntax">][</span><span class="identifier-syntax">S</span><span class="plain-syntax">][</span><span class="identifier-syntax">person</span><span class="plain-syntax">][</span><span class="identifier-syntax">number</span><span class="plain-syntax">]); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">default:</span><span class="plain-syntax"> </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"only parts 1, 2, 3 can be extracted"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">continue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_5" class="paragraph-anchor"></a><b>&#167;8.5. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">A plus-plus-digit indicates auxiliary modal usage</span><span class="named-paragraph-number">8.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">chunk</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ptoken_category</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FIXED_WORD_PTC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Vocabulary::get_exemplar</span><span class="plain-syntax">(</span><span class="identifier-syntax">chunk</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ve_pt</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">p</span><span class="plain-syntax">[0] == </span><span class="character-syntax">'+'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[1] == </span><span class="character-syntax">'+'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Characters::isdigit</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">[2])) &amp;&amp;</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[3] == </span><span class="constant-syntax">0</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">modal_following</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                *</span><span class="identifier-syntax">modal_following</span><span class="plain-syntax"> = ((</span><span class="reserved-syntax">int</span><span class="plain-syntax">) </span><span class="identifier-syntax">p</span><span class="plain-syntax">[2]) - ((</span><span class="reserved-syntax">int</span><span class="plain-syntax">) </span><span class="character-syntax">'0'</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">continue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. </b>Whenever we read a single word, it passes through the following. A word
like "fish" will pass through unchanged; a number like "7" will convert
to verb form 7 in the current verb (for example, 2 becomes the present
participle); a plus sign joins two pieces together; and a tilde is a tie,
joining but with a space. Thus <span class="extract"><span class="extract-syntax">fish~to~fry</span></span> becomes three words.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="function-syntax">Conjugation::expand_with_endings</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">Conjugation::expand_with_endings</span></span>:<br/><a href="3-vc.html#SP7_2_1">&#167;7.2.1</a>, <a href="3-vc.html#SP8_1">&#167;8.1</a>, <a href="3-vc.html#SP8_4">&#167;8.4</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">vocabulary_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ve</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ve</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">WordAssemblages::lit_0</span><span class="plain-syntax">();</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Vocabulary::get_exemplar</span><span class="plain-syntax">(</span><span class="identifier-syntax">ve</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">]; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">i</span><span class="plain-syntax">&gt;0) &amp;&amp; (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">+1]) &amp;&amp; ((</span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">] == </span><span class="character-syntax">'+'</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">] == </span><span class="character-syntax">'~'</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">vocabulary_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">front</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Vocabulary::entry_for_partial_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">-1);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">vocabulary_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">back</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Vocabulary::entry_for_partial_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">+1, </span><span class="identifier-syntax">Wide::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">)-1);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">front_wa</span><span class="plain-syntax"> = </span><a href="3-vc.html#SP9" class="function-link"><span class="function-syntax">Conjugation::expand_with_endings</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">front</span><span class="plain-syntax">, </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">back_wa</span><span class="plain-syntax"> = </span><a href="3-vc.html#SP9" class="function-link"><span class="function-syntax">Conjugation::expand_with_endings</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">back</span><span class="plain-syntax">, </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">TEMP</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">TEMP</span><span class="plain-syntax">, </span><span class="string-syntax">"%A"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">front_wa</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">] == </span><span class="character-syntax">'~'</span><span class="plain-syntax">) </span><span class="identifier-syntax">PUT_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">TEMP</span><span class="plain-syntax">, </span><span class="character-syntax">' '</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">TEMP</span><span class="plain-syntax">, </span><span class="string-syntax">"%A"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">back_wa</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Feeds::feed_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">TEMP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">TEMP</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">WordAssemblages::from_wording</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">X</span><span class="plain-syntax"> = </span><a href="3-vc.html#SP11" class="function-link"><span class="function-syntax">Conjugation::ve_to_verb_form_number</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ve</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">X</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">verb_forms</span><span class="plain-syntax">[</span><span class="identifier-syntax">X</span><span class="plain-syntax">];</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">WordAssemblages::lit_1</span><span class="plain-syntax">(</span><span class="identifier-syntax">ve</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. </b>The final step in merging verb material is to pass the result through the
following, which attends to contractions. (Most of the time it does nothing.)
For example, suppose we have:
</p>

<pre class="Preform-displayed-code all-displayed-code code-font">
<span class="Preform-plain-syntax">    </span><span class="Preform-constant-syntax">ne-'</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">ai</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">pas</span>
</pre>
<p class="commentary">The <span class="extract"><span class="Preform-extract-syntax">-'</span></span> marker tells us that the word it attaches to should contract if a
vowel follows it. In this case that's what happens, so we convert to:
</p>

<pre class="Preform-displayed-code all-displayed-code code-font">
<span class="Preform-plain-syntax">    </span><span class="Preform-constant-syntax">n'ai</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">pas</span>
</pre>
<p class="commentary">On the other hand,
</p>

<pre class="Preform-displayed-code all-displayed-code code-font">
<span class="Preform-plain-syntax">    </span><span class="Preform-constant-syntax">ne-'</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">jette</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">pas</span>
</pre>
<p class="commentary">would convert to
</p>

<pre class="Preform-displayed-code all-displayed-code code-font">
<span class="Preform-plain-syntax">    </span><span class="Preform-constant-syntax">ne</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">jette</span><span class="Preform-plain-syntax"> </span><span class="Preform-constant-syntax">pas</span>
</pre>
<p class="commentary">with no contraction. Either way, though, we have to take some action when
we see a <span class="extract"><span class="Preform-extract-syntax">-'</span></span> marker.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="function-syntax">Conjugation::shorten_with_contractions</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">Conjugation::shorten_with_contractions</span></span>:<br/><a href="3-vc.html#SP8">&#167;8</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">wa</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">vocabulary_entry</span><span class="plain-syntax"> **</span><span class="identifier-syntax">words</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">word_count</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WordAssemblages::as_array</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">wa</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">words</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">word_count</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">word_count</span><span class="plain-syntax">-1; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Vocabulary::get_exemplar</span><span class="plain-syntax">(</span><span class="identifier-syntax">words</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">], </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> *</span><span class="identifier-syntax">q</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Vocabulary::get_exemplar</span><span class="plain-syntax">(</span><span class="identifier-syntax">words</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">+1], </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">j</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Wide::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">)-2;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">j</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">] == </span><span class="character-syntax">'-'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">+1] == </span><span class="character-syntax">'\''</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">TEMP</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">contract_this</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-vc.html#SP10_1" class="named-paragraph-link"><span class="named-paragraph">Decide whether a contraction is needed here</span><span class="named-paragraph-number">10.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">contract_this</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">k</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">k</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">k</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">j</span><span class="plain-syntax">-1; </span><span class="identifier-syntax">k</span><span class="plain-syntax">++) { </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">TEMP</span><span class="plain-syntax">, </span><span class="string-syntax">"%c"</span><span class="plain-syntax">, </span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">k</span><span class="plain-syntax">]); }</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">TEMP</span><span class="plain-syntax">, </span><span class="string-syntax">"'%w"</span><span class="plain-syntax">, </span><span class="identifier-syntax">q</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Feeds::feed_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">TEMP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">words</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">] = </span><span class="identifier-syntax">Lexer::word</span><span class="plain-syntax">(</span><span class="identifier-syntax">Wordings::first_wn</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">));</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">k</span><span class="plain-syntax">=</span><span class="identifier-syntax">i</span><span class="plain-syntax">+1; </span><span class="identifier-syntax">k</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">word_count</span><span class="plain-syntax">; </span><span class="identifier-syntax">k</span><span class="plain-syntax">++) </span><span class="identifier-syntax">words</span><span class="plain-syntax">[</span><span class="identifier-syntax">k</span><span class="plain-syntax">] = </span><span class="identifier-syntax">words</span><span class="plain-syntax">[</span><span class="identifier-syntax">k</span><span class="plain-syntax">+1];</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">word_count</span><span class="plain-syntax">--;</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WordAssemblages::truncate_to</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">wa</span><span class="plain-syntax">, </span><span class="identifier-syntax">word_count</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">k</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">k</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">k</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">j</span><span class="plain-syntax">; </span><span class="identifier-syntax">k</span><span class="plain-syntax">++) { </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">TEMP</span><span class="plain-syntax">, </span><span class="string-syntax">"%c"</span><span class="plain-syntax">, </span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">k</span><span class="plain-syntax">]); }</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Feeds::feed_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">TEMP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">words</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">] = </span><span class="identifier-syntax">Lexer::word</span><span class="plain-syntax">(</span><span class="identifier-syntax">Wordings::first_wn</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">TEMP</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">wa</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP10_1" class="paragraph-anchor"></a><b>&#167;10.1. </b>We contract if the following word starts with a (possibly accented) vowel,
and we construe "y" (but not "h" or "w") as a vowel.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Decide whether a contraction is needed here</span><span class="named-paragraph-number">10.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">incipit</span><span class="plain-syntax"> = </span><span class="identifier-syntax">q</span><span class="plain-syntax">[0];</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">first</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Characters::tolower</span><span class="plain-syntax">(</span><span class="identifier-syntax">Characters::remove_accent</span><span class="plain-syntax">(</span><span class="identifier-syntax">incipit</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">first</span><span class="plain-syntax"> == </span><span class="character-syntax">'a'</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">first</span><span class="plain-syntax"> == </span><span class="character-syntax">'e'</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">first</span><span class="plain-syntax"> == </span><span class="character-syntax">'i'</span><span class="plain-syntax">) ||</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">first</span><span class="plain-syntax"> == </span><span class="character-syntax">'o'</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">first</span><span class="plain-syntax"> == </span><span class="character-syntax">'u'</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">first</span><span class="plain-syntax"> == </span><span class="character-syntax">'y'</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">contract_this</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vc.html#SP10">&#167;10</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. Parsing verb form numbers.</b>These are easy: they're just written as arabic numbers.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Conjugation::ptoken_to_verb_form_number</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">Conjugation::ptoken_to_verb_form_number</span></span>:<br/><a href="3-vc.html#SP7_2_1">&#167;7.2.1</a>, <a href="3-vc.html#SP8_3">&#167;8.3</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">ptoken</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pt</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">pt</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ptoken_category</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FIXED_WORD_PTC</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-vc.html#SP11" class="function-link"><span class="function-syntax">Conjugation::ve_to_verb_form_number</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ve_pt</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> -1;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Conjugation::ve_to_verb_form_number</span><button class="popup" onclick="togglePopup('usagePopup10')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup10">Usage of <span class="code-font"><span class="function-syntax">Conjugation::ve_to_verb_form_number</span></span>:<br/><a href="3-vc.html#SP9">&#167;9</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">vocabulary_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ve</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Vocabulary::test_vflags</span><span class="plain-syntax">(</span><span class="identifier-syntax">ve</span><span class="plain-syntax">, </span><span class="identifier-syntax">NUMBER_MC</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">X</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Vocabulary::get_literal_number_value</span><span class="plain-syntax">(</span><span class="identifier-syntax">ve</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">X</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">X</span><span class="plain-syntax"> &lt; </span><span class="constant-syntax">MAX_FORM_TYPES</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">X</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> -1;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP12" class="paragraph-anchor"></a><b>&#167;12. Parsing tense and sense indicators.</b>These are a little harder: for example, <span class="extract"><span class="extract-syntax">t2+</span></span> or <span class="extract"><span class="extract-syntax">t3</span></span>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Conjugation::ptoken_to_tense_indicator</span><button class="popup" onclick="togglePopup('usagePopup11')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup11">Usage of <span class="code-font"><span class="function-syntax">Conjugation::ptoken_to_tense_indicator</span></span>:<br/><a href="3-vc.html#SP8_4">&#167;8.4</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">ptoken</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pt</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">set_sense</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">pt</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ptoken_category</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FIXED_WORD_PTC</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vocabulary_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ve</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ve_pt</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Vocabulary::get_exemplar</span><span class="plain-syntax">(</span><span class="identifier-syntax">ve</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">p</span><span class="plain-syntax">[0] == </span><span class="character-syntax">'t'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Characters::isdigit</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">[1])) &amp;&amp; (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[2] == </span><span class="constant-syntax">0</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">int</span><span class="plain-syntax">) (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[1] - </span><span class="character-syntax">'1'</span><span class="plain-syntax"> + </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">N</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">1</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">N</span><span class="plain-syntax"> &lt;= </span><span class="constant-syntax">NO_KNOWN_TENSES</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">p</span><span class="plain-syntax">[0] == </span><span class="character-syntax">'t'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Characters::isdigit</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">[1])) &amp;&amp;</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[2] == </span><span class="character-syntax">'+'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[3] == </span><span class="constant-syntax">0</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">int</span><span class="plain-syntax">) (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[1] - </span><span class="character-syntax">'1'</span><span class="plain-syntax"> + </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">N</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">1</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">N</span><span class="plain-syntax"> &lt;= </span><span class="constant-syntax">NO_KNOWN_TENSES</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                *</span><span class="identifier-syntax">set_sense</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">p</span><span class="plain-syntax">[0] == </span><span class="character-syntax">'t'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Characters::isdigit</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">[1])) &amp;&amp;</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[2] == </span><span class="character-syntax">'-'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[3] == </span><span class="constant-syntax">0</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">int</span><span class="plain-syntax">) (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[1] - </span><span class="character-syntax">'1'</span><span class="plain-syntax"> + </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">N</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">1</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">N</span><span class="plain-syntax"> &lt;= </span><span class="constant-syntax">NO_KNOWN_TENSES</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                *</span><span class="identifier-syntax">set_sense</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> -1;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP13" class="paragraph-anchor"></a><b>&#167;13. Parsing utilities.</b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Conjugation::ptoken_as_bracket</span><button class="popup" onclick="togglePopup('usagePopup12')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup12">Usage of <span class="code-font"><span class="function-syntax">Conjugation::ptoken_as_bracket</span></span>:<br/><a href="3-vc.html#SP8_3">&#167;8.3</a>, <a href="3-vc.html#SP8_4">&#167;8.4</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">ptoken</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pt</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">pt</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ptoken_category</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FIXED_WORD_PTC</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vocabulary_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ve</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ve_pt</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ve</span><span class="plain-syntax"> == </span><span class="identifier-syntax">OPENBRACKET_V</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ve</span><span class="plain-syntax"> == </span><span class="identifier-syntax">CLOSEBRACKET_V</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> -1;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP14" class="paragraph-anchor"></a><b>&#167;14. </b>In the following, for example, "breveter" as <span class="extract"><span class="extract-syntax">ve</span></span> would match "-veter"
as <span class="extract"><span class="extract-syntax">pattern</span></span>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Conjugation::compare_ve_with_tails</span><button class="popup" onclick="togglePopup('usagePopup13')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup13">Usage of <span class="code-font"><span class="function-syntax">Conjugation::compare_ve_with_tails</span></span>:<br/><a href="3-vc.html#SP7_1_1_1">&#167;7.1.1.1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">vocabulary_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ve</span><span class="plain-syntax">, </span><span class="identifier-syntax">vocabulary_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pattern</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ve</span><span class="plain-syntax"> == </span><span class="identifier-syntax">pattern</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Vocabulary::get_exemplar</span><span class="plain-syntax">(</span><span class="identifier-syntax">pattern</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[0] == </span><span class="character-syntax">'-'</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> *</span><span class="identifier-syntax">q</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Vocabulary::get_exemplar</span><span class="plain-syntax">(</span><span class="identifier-syntax">ve</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">, </span><span class="identifier-syntax">j</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Wide::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">q</span><span class="plain-syntax">)-(</span><span class="identifier-syntax">Wide::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">)-1);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">i</span><span class="plain-syntax">=1; </span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">]; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++, </span><span class="identifier-syntax">j</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">j</span><span class="plain-syntax">&lt;0) || (</span><span class="identifier-syntax">p</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">] != </span><span class="identifier-syntax">q</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">]))</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP15" class="paragraph-anchor"></a><b>&#167;15. Errors.</b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Conjugation::error</span><button class="popup" onclick="togglePopup('usagePopup14')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup14">Usage of <span class="code-font"><span class="function-syntax">Conjugation::error</span></span>:<br/><a href="3-vc.html#SP6_3_2">&#167;6.3.2</a>, <a href="3-vc.html#SP6_3_2_1_3">&#167;6.3.2.1.3</a>, <a href="3-vc.html#SP7">&#167;7</a>, <a href="3-vc.html#SP7_1_1">&#167;7.1.1</a>, <a href="3-vc.html#SP7_2">&#167;7.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">base_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">nonterminal</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nt</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">production</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pr</span><span class="plain-syntax">, </span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">message</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PreformUtilities::error</span><span class="plain-syntax">(</span><span class="identifier-syntax">base_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">nt</span><span class="plain-syntax">, </span><span class="identifier-syntax">pr</span><span class="plain-syntax">, </span><span class="identifier-syntax">message</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">exit</span><span class="plain-syntax">(1);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP16" class="paragraph-anchor"></a><b>&#167;16. Testing.</b>Similarly, the following helps translators by giving them unit tests for their
conjugations:
</p>

<blockquote>
    <p>Test verb (internal) with appuyer.</p>
</blockquote>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Conjugation::test</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax">, </span><span class="identifier-syntax">NATURAL_LANGUAGE_WORDS_TYPE</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nl</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vc</span><span class="plain-syntax"> = </span><a href="3-vc.html#SP6" class="function-link"><span class="function-syntax">Conjugation::conjugate</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WordAssemblages::from_wording</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">), </span><span class="identifier-syntax">nl</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">vc</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) { </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"Failed test\n"</span><span class="plain-syntax">); </span><span class="reserved-syntax">return</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    </span><a href="3-vc.html#SP5" class="function-link"><span class="function-syntax">Conjugation::write</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">vc</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DESTROY</span><span class="plain-syntax">(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">, </span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP17" class="paragraph-anchor"></a><b>&#167;17. </b>This is for testing English only; it helps with the test suite cases derived
from our dictionary of 14,000 or so present and past participles.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Conjugation::test_participle</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vc</span><span class="plain-syntax"> = </span><a href="3-vc.html#SP6" class="function-link"><span class="function-syntax">Conjugation::conjugate</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WordAssemblages::from_wording</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">), </span><a href="4-dl.html#SP1" class="function-link"><span class="function-syntax">DefaultLanguage::get</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">vc</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) { </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"Failed test\n"</span><span class="plain-syntax">); </span><span class="reserved-syntax">return</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    </span><a href="3-vc.html#SP17" class="function-link"><span class="function-syntax">Conjugation::write_participle</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">vc</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DESTROY</span><span class="plain-syntax">(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">, </span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Conjugation::write_participle</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vc</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"To %A: he is %A; it was %A.\n"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infinitive</span><span class="plain-syntax">), &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">present_participle</span><span class="plain-syntax">), &amp;(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">past_participle</span><span class="plain-syntax">));</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP18" class="paragraph-anchor"></a><b>&#167;18. </b>As noted above, these nonterminals have no parsing function, and are used only
as markers in verb conjugations.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="function-syntax">&lt;auxiliary-verb-only&gt;</span><span class="plain-syntax"> </span><span class="identifier-syntax">internal</span>
<span class="plain-syntax">    ==&gt; { </span><span class="identifier-syntax">fail</span><span class="plain-syntax"> </span><span class="identifier-syntax">nonterminal</span><span class="plain-syntax"> };</span>
<span class="plain-syntax">}</span>

<span class="function-syntax">&lt;not-instance-of-verb-at-run-time&gt;</span><span class="plain-syntax"> </span><span class="identifier-syntax">internal</span>
<span class="plain-syntax">    ==&gt; { </span><span class="identifier-syntax">fail</span><span class="plain-syntax"> </span><span class="identifier-syntax">nonterminal</span><span class="plain-syntax"> };</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="3-dcl.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-im.html">1</a></li><li class="progresschapter"><a href="2-tai.html">2</a></li><li class="progresscurrentchapter">3</li><li class="progresssection"><a href="3-lc.html">lc</a></li><li class="progresssection"><a href="3-lc2.html">lc2</a></li><li class="progresssection"><a href="3-dcl.html">dcl</a></li><li class="progresscurrent">vc</li><li class="progresschapter"><a href="4-dl.html">4</a></li><li class="progressnext"><a href="4-dl.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

